import HTTP_CODE from '../constant/http-code'
import * as request from '../constant/fetch-request'

export const searchTags = () => {
  return dispatch => {
    (async () => {
      const res = await request.get(`../api/v2/tags`)
      if (res.status === HTTP_CODE.OK) {
        dispatch({
          type: 'SEARCH_TAGS',
          data: res.body
        })
      }
    })()
  }
}
